home *** CD-ROM | disk | FTP | other *** search
- Sub Main()
- 'for NetXRay objs
- Dim netxApp As Object
- Dim historyObj As Object
- Dim histDataObjs As Object
- 'for Excel objs
- Dim excelApp as Object
- Dim wb as Object
- Dim ws as Object
-
- Msg = "Please make sure there is at least 1 history window is opened!"
- DlgDef = MB_OKCANCEL + MB_ICONEXCLAMATION
- Title = "NetXRay"
- Response = MsgBox(Msg, dlgDef, Title)
- If Response = IDCANCEL Then
- GoTo ByeBye
- End If
-
- 'create NetXRay objs
- Set netxApp = CreateObject("NetXRay.Application.1")
- Set historyObj = netxApp.GetFirstHistory()
- Set histDataObjs = historyObj.GetDataObjects()
-
- 'create Excel objs
- Set excelApp = CreateObject("Excel.Application")
- excelApp.Visible = TRUE
- Set wb = excelApp.Workbooks.Add
- Set ws = excelApp.Worksheets(1)
- ws.Columns("A").NumberFormat = "mm/dd/yy hh::mm:ss AM/PM"
- ws.Columns("A").ColumnWidth = 30
-
- n = histDataObjs.Count
- For i = 1 To n
- 'MsgBox "Time(" & i & ") = " & histDataObjs.Item(i).GetTimeStr()
- 'MsgBox "Data(" & i & ") = " & histDataObjs.Item(i).GetData()
- ws.Cells(i, 1).Value = histDataObjs.Item(i).GetTimeStr()
- ws.Cells(i, 2).Value = histDataObjs.Item(i).GetData()
- Next i
-
- ByeBye:
- Msg = "Done"
- End Sub
-